package day05;

import java.util.Arrays;
import java.util.Random;

public class PracticeE5 {
    public static void main(String[] args) {
        int sum=0,muti=1;
        for (int i = 1; i <= 100; ++i) {
            if (i % 2 == 0) {
                sum+=i;
            }

        }
        System.out.println("100以内所有偶数的和为："+sum);

        for (int i = 8; i >= 1; --i) {
            muti*=i;
        }
        System.out.println("8的阶乘为："+muti);

        for (int i = 1; i <= 6; ++i) {
            for (int j = 1; j <= 2*i-1; ++j) {
                System.out.print("*");
            }
            System.out.println();
        }
        Random rand = new Random();
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; ++i) {
            arr[i] = rand.nextInt(100);
        }
        System.out.println(Arrays.toString(arr));
        Arrays.sort(arr);

        System.out.println("数组元素的最小值为："+arr[0]);
        System.out.println("数组元素的最大值为："+arr[arr.length-1]);
    }
}
